{% extends '__base__.html' %}

{% block title %}博客{% endblock %}
{% block beforehead %}
<script src="https://unpkg.com/vue@next"></script>
{% endblock %}
{% block content %}
<!-- Content Header (Page header) -->

<section class="content-header">
    <h1>
        新建博客
        <small>新建博客</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="/"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="/blog">博客</a></li>
        <li class="active">新建博客</li>
    </ol>
</section>

<div class="container" id="main">
    <div class="row">
        <div class="col">
            <h1>Index</h1>
        </div>
    </div>
</div>

</div>
{% endblock %}

{% block beforebody %}
<script>
    let showdata = {
        // data返回值是暴露的属性
        data() {
            return {
                // path: ['/root'],
                items: [],
                page: {'total': 0, 'pages': 1, 'index': 1, 'size': 12},
                pagesize: 1,
                selected: false,
                selectItem: []
            }
        },
        props: ['index'],
        methods: {
        },
        delimiters: ['+{', '}'],
        template: `
            <div class="row">
                <div class="col-10">

                </div>
            </div>
            `,
        mounted() {
        },
        watch: {
        },
        updated() {
        },
        methods: {
            loadItem(id) {
                if (index > this.page.pages) return
                axios.get('/blog/edit', {
                        id: id,
                    })
                    .then(
                        response => {
                            if (response.status === 200) {
                                let data = response.data
                                if (data['code'] === 0) {
                                    this.items = data['msg']['item']
                                } else {
                                    console.log('FAILED: ' + data['msg'])
                                }
                            }
                        })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
        },
        computed: {
        }
    }
    const app = Vue.createApp(showdata)
    // mount方法返回根组件实例
    const vm = app.mount('#main')
</script>
{% endblock %}